<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
<!--
Copyright 2008 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
  <title>Simple First Person Camera</title>
  <link rel=stylesheet href='firstpersoncam.css' type='text/css' />
  <!-- *** Replace the key below below with your own API key, available at http://code.google.com/apis/maps/signup.html *** -->
  <script src="http://www.google.com/jsapi?key=ABQIAAAAwbkbZLyhsmTCWXbTcjbgbRSzHs7K5SvaUdm8ua-Xxy_-2dYwMxQMhnagaawTo7L1FE1-amhuQxIlXw"></script>
  <script type="text/javascript" src="../../lib/math3d.js"></script>
  <script type="text/javascript" src="../../lib/keyboard-focus-hack.js"></script>
  <script type="text/javascript" src="firstpersoncam.js"></script>
  <script type="text/javascript">
google.load("earth", "1");
google.load("maps", "2");

var ge = null;
var cam;

function init() {
  init3D();
}

function initCB(object) {
  ge = object;
  ge.getOptions().setFlyToSpeed(100);

  ge.getLayerRoot().enableLayerById(ge.LAYER_BUILDINGS, true);

  cam = new FirstPersonCam();
  cam.updateCamera();
  ge.getWindow().setVisibility(true);

  keyboardFocusHack(ge);
}

function failureCB(object) {
  /***
   * This function will be called if plugin fails to load, in case
   * you need to handle that error condition.
   ***/
}

function init3D() {
  google.earth.createInstance("map3d", initCB, failureCB);
}

  </script>
</head>
<body onload='init()' onunload="GUnload()" onKeyDown="return keyDown(event);" onKeyUp="return keyUp(event);" id='body'>
  <div class="title">
    <b>First Person Camera</b>
  </div>
  
  <table border=0>
  <tr>
    <td>
      <div id='map3d'></div>
    </td>
    <td valign=top>
    KEYBOARD CAMERA CONTROLS<br>
    <br>
    Movement:<br>
    &nbsp;&nbsp;W = Forwards<br>
    &nbsp;&nbsp;S = Backwards<br>
    &nbsp;&nbsp;A = Strafe Left<br>
    &nbsp;&nbsp;D = Strafe Right<br>
    &nbsp;&nbsp;Page Up = Move Up<br>
    &nbsp;&nbsp;Page Down = Move Down<br>
    <br>
    Camera View:<br>
    &nbsp;&nbsp;Up Arrow = Tilt up<br>
    &nbsp;&nbsp;Down Arrow = Tilt down<br>
    &nbsp;&nbsp;Right Arrow = Turn right<br>
    &nbsp;&nbsp;Left Arrow = Turn left<br>  
    </td>
  </tr>
  </table>  
</body>
</html>
